﻿using Ongoal.Quotation.Service.Common;
using Ongoal.Quotation.Service.Model.basemodel;
using Ongoal.Quotation.Service.Model.Sys;
using Ongoal.Quotation.Service.Param;
using Ongoal.Quotation.Service.ViewModel;

namespace Ongoal.Quotation.Service
{
    public interface ITableInfoService
    {
        /// <summary>
        /// 创建元数据表
        /// </summary>
        /// <param name="viewModel"></param>
        void saveTableinfo(TableInfoView viewModel);
        /// <summary>
        /// 生成数据库表结构
        /// </summary>
        /// <param name="listtables"></param>
        /// <param name="dbid"></param>
        void CreateTables(List<TableInfoView> listtables,int dbid);

        /// <summary>
        /// 删除元数据表
        /// </summary>
        /// <param name="listtable"></param>
        void deleteTableinfolist(List<TableInfoView> listtable);


        /// <summary>
        /// 查询表视图
        /// </summary>
        /// <param name="PaginationEntity"></param>
        /// <param name="keyword"></param>
        /// <param name="sourseId"></param>
        /// <returns></returns>
        object selecttableview(PaginationData PaginationEntity, string keyword, int sourseId);

        /// <summary>
        /// 删除表视图
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool deletetableview(int id);
        /// <summary>
        /// 根据表ID查询字段信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        object GetFieldinfo(int id);

        /// <summary>
        /// 根据表名获取字段信息
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        object GetFieldinfoByName(string name);
        /// <summary>
        /// 显示实体
        /// </summary>
        /// <param name="tablename"></param>
        /// <returns></returns>
        object ShowEntity(string tablename);
        /// <summary>
        /// 获取表数据
        /// </summary>
        /// <param name="dbid"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        object Gettablelist(int dbid, string name);

        /// <summary>
        /// 导入实体
        /// </summary>
        /// <param name="tablelist"></param>
        /// <param name="dbid"></param>
        /// <returns></returns>
        bool importtable(List<V_Tableinfo> tablelist, int dbid);

        /// <summary>
        /// 获取显示表
        /// </summary>
        /// <param name="keyword"></param>
        /// <returns></returns>
        object GetInterfaceTable(string keyword);
        /// <summary>
        /// 获取显示字段
        /// </summary>
        /// <param name="Interfacetableid"></param>
        /// <returns></returns>
        object GetInterfacesetting(int Interfacetableid);

        /// <summary>
        /// 导入表信息
        /// </summary>
        /// <param name="tablelist"></param>
        /// <returns></returns>
        object leadinterface(List<T_TableInfo> tablelist);

        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="Interfaceid"></param>
        object overloadlead(int Interfaceid);
        /// <summary>
        /// 编辑显示字段信息
        /// </summary>
        /// <param name="entitys"></param>
        object Editinterfacesetting(List<T_Sys_Interfacesettings> entitys);
        /// <summary>
        /// 获取没有导入的表格
        /// </summary>
        /// <returns></returns>
        object GetNotleadinTables(string keyword);

        /// <summary>
        /// 获取表格显示信息
        /// </summary>
        /// <param name="tablename"></param>
        /// <returns></returns>
        object GetshowTableInfo(string tablename);

        #region 表与字段
        /// <summary>
        /// 获取所有表
        /// </summary>
        /// <param name="TableName">表名</param>
        /// <returns></returns>
        object GetTablesList(string TableName);

        /// <summary>
        /// 根据表ID获取表所有字段
        /// </summary>
        /// <param name="TableId"></param>
        /// <param name="FiledName">字段名</param>
        /// <returns></returns>
        object GetFiledsList(int TableId, string FiledName);
        /// <summary>
        /// 可查询表集合
        /// </summary>
        /// <param name="Param">参数实体</param>
        /// <returns></returns>
        object GetWhereTableList(PublicParam Param);

        /// <summary>
        /// 获取代码表
        /// </summary>
        /// <param name="Param">参数实体</param>
        /// <returns></returns>
        object GetCodeTableList(PublicParam Param);

        #endregion

    }
}
